const appInstance = getApp()

Page({

  /**
   * 页面的初始数据
   */
  data: {    
    bg_url:'/images/personal/usermessage_bg.jpg',
    head_img:'头像',
    nickname:'昵称',
    account:'账号',
    sex:'性别',
    area:'地区',
    signal:'个性签名',
    // 基本信息值
    userMessage:{}
  },
  onShow(){
   var that=this
   console.log('加载个人资料页面了')
  /**
   *   判断js对象是否为: {}
   */
  if( JSON.stringify( that.data.userMessage ) == "{}"){    
    console.log('开始获取本地用户的基本信息了-----')
    that.getBasicMessage()
  }
  
  // 获取页面栈信息
  that.getPageShed()
 },
 getBasicMessage(){
   var that=this
   if( wx.getStorageSync('basicMessage') != '' ){
    var userMessage=wx.getStorageSync('basicMessage')   
    that.setData({
      userMessage:userMessage
     })
   }
   
 },
//  绑定一个返回事件
handleReturn(){
  wx.navigateBack({
    delta:1,
    success:function(e){
      console.log('成功返回上一级页面')
    },
    fail:function(e){
      console.log(e)
    }
  })
},
getPageShed(){
  var that=this
  console.log(getCurrentPages())
}
})